<%@page import="org.apache.ibatis.scripting.xmltags.ForEachSqlNode"%>
<%-- <%@page import="com.po.Choose_course"%>
<%@page import="java.util.List"%>
<%@page import="com.po.User"%> --%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>课程管理</title>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
</head>
<body>
<jsp:include page="/center/header.jsp"></jsp:include>
	<jsp:include page="/center/left.jsp" flush="true"></jsp:include>
   <!--right-->
    <div class="centers_mr">
 <%--    <%User user = (User)request.getSession().getAttribute("user"); %>
    <h1 class="welcom_tm">欢迎您，尊敬的用户     <font><%=user.getUsername() %></font>！当前时间为 <label id="show">显示时间的位置</label></h1>
 --%>    <script type="text/javascript">
//获得当前时间,刻度为一千分一秒
var initializationTime=(new Date()).getTime();
function showLeftTime()
{
var now=new Date();
var year=now.getYear()+1900;
var month=now.getMonth();
var day=now.getDate();
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();
document.getElementById("show").innerHTML=""+year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds+"";
//一秒刷新一次显示时间
var timeID=setTimeout(showLeftTime,1000);
}
showLeftTime();
</script> 	<div class="public_m1">
            <div class="public_m2">课程管理</div>
            <!--一个课程管理信息-->
            <script type="text/javascript">
         <%--    var user_id = <%=user.getId() %>;
         --%>    $.ajax({
                url : "<%=path%>"+"/Course/Choose_courseListByUser_id.action",
                type : "GET",
                dataType : "json",
                contentType : "application/json;charset=UTF-8",
                data : "id="+user_id,
                success : function(data) {
                	console.log('查询课程')
                	console.log(data);
                	if(data.code==200){
							if(data.message){
								window.location.reload();//页面刷新
							}
                		/*
                		var course = data.data;
                		var eleResult = document.getElementById("course_list_id");
                		 for(var key in data.data){
                		var eleTr = document.createElement("tr");
                		var choose_course = data.data[key];
                		 console.log('我的选课');
                		console.log(choose_course);
                		var choosekey = ['course_id','course_name','teacher','start_time']
                		var eleTd = document.createElement("td");
                			console.log('每个字段');
                			console.log(data.data[key]['course_id']);
                			eleTd.innerHtml=data.data[key]['course_id'];
                			eleTr.appendChild(eleTd);
                		eleResult.appendChild(eleTr);
                	        }    
                		
                		*/
                	}
                }
            });
            </script>
            <div class="public_m5">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tbody id="course_list_id">
                        <tr style=" border-bottom:1px solid #000">       
                            <th class="olist1">课程编号</th>       
                            <th class="olist2">课程名称</th>       
                            <th class="olist3">授课老师</th>        
                            <th class="olist4">上课时间</th>        
                            <th class="olist5">操作</th>
                        </tr>   
                   <%--      <%List<Choose_course> choose_courses = (List<Choose_course>)request.getSession().getAttribute("choose_courses");
                        	if(choose_courses!=null && choose_courses.size()>0){
                        		for(Choose_course c : choose_courses){
                        %>
                        
                        <tr>        
                            <td><%=c.getCourse_id() %></td>    
                            <td><%=c.getCourse_name() %></td>       
                            <td><%=c.getTeacher() %></td>
                            <td><%=c.getStart_time() %></td>
                            <td><a href="#">获取课程码</a></td>
                        </tr>
                        <%}} %> --%>
                    </tbody>
                </table>
            </div>
            <!--查看更多-->
            <div class="chagd_m">
                <a href="#">查看更多</a>
            </div>
        </div>
                                                   
    </div>
  </body>
</html>